Triangular function
part 3/7 · 9.8 KB total
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
tri ( 2 x ) = Λ Λ ( 2 x ) = def max ( 1 − − 2 | x | , 0 ) = { 1 − − 2 | x | , | x | < 1 2 ; 0 otherwise . {\displaystyle {\begin{aligned}\operatorname {tri} (2x)=\Lambda (2x)\ &{\overset {\underset {\text{def}}{}}{=}}\ \max {\big (}1-2|x|,0{\big )}\\&={\begin{cases}1-2|x|,&|x|<{\tfrac {1}{2}};\\0&{\text{otherwise}}.\\\end{cases}}\end{aligned}}}
tri j ( x ) = { ( x − − x j − − 1 ) / ( x j − − x j − − 1 ) , x j − − 1 ≤ ≤ x < x j ; ( x j + 1 − − x ) / ( x j + 1 − − x j ) , x j ≤ ≤ x < x j + 1 ; 0 otherwise . {\displaystyle \operatorname {tri} _{j}(x)={\begin{cases}(x-x_{j-1})/(x_{j}-x_{j-1}),&x_{j-1}\leq x<x_{j};\\(x_{j+1}-x)/(x_{j+1}-x_{j}),&x_{j}\leq x<x_{j+1};\\0&{\text{otherwise}}.\end{cases}}}
Whereas the definition at the top is a special case
Λ Λ ( x ) = tri j ( x ) , {\displaystyle \Lambda (x)=\operatorname {tri} _{j}(x),}
where x j − − 1 = − − 1 {\displaystyle x_{j-1}=-1} , x j = 0 {\displaystyle x_{j}=0} , and x j + 1 = 1 {\displaystyle x_{j+1}=1} .
A linear B-spline is the same as a continuous piecewise linear function f ( x ) {\displaystyle f(x)} , and this general triangle function is useful to formally define f ( x ) {\displaystyle f(x)} as
f ( x ) = ∑ ∑ j y j ⋅ ⋅ tri j ( x ) , {\displaystyle f(x)=\sum _{j}y_{j}\cdot \operatorname {tri} _{j}(x),}
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────